<template>
    <div class="mainBody">
        <Banner></Banner>
        <Content>
            <template slot="left">
                <content-one title="特别推荐">
                    <template slot="content">
                        <special-recommon></special-recommon>
                    </template>
                </content-one>
                <content-one title="最新文章">
                    <template slot="content">
                        <latest-articles :article-list="latestList"></latest-articles>
                    </template>
                </content-one>
            </template>
            <template slot="right">
                <content-two title="关于我">
                    <template slot="content">
                        <about-me></about-me>
                    </template>
                </content-two>
                <click-rank :article-list="articleList"></click-rank>
                <wechat-attention></wechat-attention>
            </template>
        </Content>
        <router-view></router-view>
    </div>
</template>

<script>
    import { searchArticleMixins } from 'assets/js/mixins';
    import Banner from './components/Banner';
    import Content from 'cmpts/Content';
    import ContentOne from 'cmpts/ContentOne';
    import SpecialRecommon from './components/SpecialRecommon';
    import LatestArticles from 'cmpts/LatestArticles';
    import ContentTwo from 'cmpts/ContentTwo';
    import AboutMe from './components/AboutMe';
    import WechatAttention from 'cmpts/WechatAttention';
    import ClickRank from 'cmpts/ClickRank';
    export default {
        components: {
            Banner,
            Content,
            ContentOne,
            SpecialRecommon,
            LatestArticles,
            ContentTwo,
            AboutMe,
            WechatAttention,
            ClickRank
        },
        mixins: [
            searchArticleMixins
        ],
        data () {
            return {
                paramsJson: {
                    type: 'readingTimes'
                },
                latestList: []
            };
        },
        mounted () {
            // 获取最新文章
            this.searchArticle({}).then(res => {
                this.latestList = res;
            });
        }
    };
</script>

<style lang="less" scoped>

</style>
